﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Head
{
    @Html.Css("EditForm", "RightSeparateModule", "dp")
    @Html.Js("datepicker")
   @* <script src="../../Scripts/datepicker-zh.js" type="text/javascript"></script>*@
    <script type="text/javascript">

        var maiheight = document.documentElement.clientHeight;
        var mainWidth = document.documentElement.clientWidth; // 减去左边的宽度
        $(document).ready(function () {

            //  $("#txtDate").datepicker({ picker: "<img class='picker' align='middle' src='../../Images/icons/s.gif' alt=''/>" });
            var gh = maiheight - 150;
            var options = {
                height: gh,
                width: mainWidth,
                url: '@Url.Action("GetDetailList")',
                colModel: [
                    { display: 'ID', name: 'ID', width: 60, sortable: false, align: 'left', hide: true, iskey: true },
                    { display: '抄表日期', name: 'CBDT', width: 80, sortable: false, hide: false, align: 'left' },
			        { display: '班组编号', name: 'GroupNo', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '当班人员', name: 'GroupMan', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '机器编号', name: 'MachNo', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '开机时间', name: 'OpenMachDt', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '停机时间', name: 'StopMachDt', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '燃气类型', name: 'RanqiType', width: 70, sortable: false, hide: false, align: 'left' },
                    { display: '项目', name: 'TeamNo', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '7:00(19:00)', name: 'StartTime', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '8:00(20:00)', name: 'OneTime', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '9:00(21:00)', name: 'TwoTime', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '10:00(22:00)', name: 'ThreeTime', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '11:00(23:00)', name: 'FourTime', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '12:00(00:00)', name: 'FiveTime', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '13:00(1:00)', name: 'SixTime', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '14:00(2:00)', name: 'SevenTime', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '15:00(3:00)', name: 'EightTime', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '16:00(4:00)', name: 'NineTime', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '17:00(5:00)', name: 'TenTime', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '18:00(6:00)', name: 'ElevenTime', width: 80, sortable: false, hide: false, align: 'left' }
                  	],
                buttons: [
                            { name: 'Add', displayname: "新建", title: "新建", bclass: 'add', onpress: toolbarItem_onclick },
                            { separator: true }
                         ],
                singleselected: false,
                title: false,
                usepager: true,
                page: 1,
                rp: 20,
                rpOptions: [10, 15, 20],
                showcheckbox: true,
                rowbinddata: true
            };
            $("#gasTable").flexigrid(options);
            //新增，删除，修改
            function toolbarItem_onclick(cmd, grid) {
                if (cmd == "Add") {
                    OpenModelWindow('@Url.Action("Add")',
                        {
                            width: 764,
                            height: 687,
                            caption: "燃气录入",
                            onclose: refresh
                        }
                       );
                }
            }
            function refresh() {
                options.query = "";
                options.newp = 0;
                $("#gasTable").flexOptions(options).flexReload();
            }
        });
    
    </script>
}
<div id="container">
    <div class="title">
        <table>
            <tr>
                <td>
                    日期： @Html.TextBox("txtDate")
                </td>
                <td>
                    早晚班： @Html.DropDownList("ddlTime", ViewBag.QueryTime as IEnumerable<SelectListItem>,
                                   new { @style = "width:152px; height:22px; font-size:13px;" })
                </td>
                <td>
                    <a id="btnQueryList" class="button" href="javascript:void(0);"><span>查 询</span></a>
                </td>
            </tr>
        </table>
    </div>
    <div class="title">
    <table width="100%">
        <tr>
            <td>
                日期:
            </td>
            <td>
                早班当班人：
            </td>
            <td>
                开机编号：
            </td>
        </tr>
        <tr>
            <td>
                每小时记录一次
            </td>
            <td>
                开机时间：
            </td>
            <td>
                停机时间：
            </td>
        </tr>
    </table>
    </div>
    <table id="gasTable" style="display: none">
    </table>
    天然气抄表读数（抄表时间：）
</div>
